home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 August: Technology Seed / August 1998 ADC Seed CD.toast / Mac OS 8.5b2 / allegro-b2-pseudo-SDK / CIncludes / ConditionalMacros.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-07-17  |  41.1 KB  |  1,334 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        ConditionalMacros.h
  3.  
  4.      Contains:    Set up for compiler independent conditionals
  5.  
  6.      Version:    Technology:    Universal Interface Files 3.1
  7.                  Release:    Allego Seed, Use with 3.1 Universal Interfaces
  8.  
  9.      Copyright:    © 1993-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __CONDITIONALMACROS__
  19. #define __CONDITIONALMACROS__
  20.  
  21. /****************************************************************************************************
  22.     UNIVERSAL_INTERFACES_VERSION
  23.     
  24.         0x0310 => version 3.1
  25.         0x0301 => version 3.0.1
  26.         0x0300 => version 3.0
  27.         0x0210 => version 2.1
  28.         This conditional did not exist prior to version 2.1
  29. ****************************************************************************************************/
  30. #define UNIVERSAL_INTERFACES_VERSION 0x0310
  31.  
  32. /****************************************************************************************************
  33.  
  34.     TARGET_CPU_≈    
  35.     These conditionals specify which microprocessor instruction set is being
  36.     generated.  At most one of these is true, the rest are false.
  37.  
  38.         TARGET_CPU_PPC            - Compiler is generating PowerPC instructions
  39.         TARGET_CPU_68K            - Compiler is generating 680x0 instructions
  40.         TARGET_CPU_X86            - Compiler is generating x86 instructions
  41.         TARGET_CPU_MIPS            - Compiler is generating MIPS instructions
  42.         TARGET_CPU_SPARC        - Compiler is generating Sparc instructions
  43.         TARGET_CPU_ALPHA        - Compiler is generating Dec Alpha instructions
  44.  
  45.  
  46.     TARGET_OS_≈    
  47.     These conditionals specify in which Operating System the generated code will
  48.     run. At most one of the these is true, the rest are false.
  49.  
  50.         TARGET_OS_MAC            - Generate code will run under Mac OS
  51.         TARGET_OS_WIN32            - Generate code will run under 32-bit Windows
  52.         TARGET_OS_UNIX            - Generate code will run under some unix 
  53.  
  54.  
  55.     TARGET_RT_≈    
  56.     These conditionals specify in which runtime the generated code will
  57.     run. This is needed when the OS and CPU support more than one runtime
  58.     (e.g. MacOS on 68K supports CFM68K and Classic 68k).
  59.  
  60.         TARGET_RT_LITTLE_ENDIAN    - Generated code uses little endian format for integers
  61.         TARGET_RT_BIG_ENDIAN    - Generated code uses big endian format for integers     
  62.         TARGET_RT_MAC_CFM        - TARGET_OS_MAC is true and CFM68K or PowerPC CFM being used    
  63.         TARGET_RT_MAC_68881        - TARGET_OS_MAC is true and 68881 floating point instructions used    
  64.  
  65.  
  66.     PRAGMA_≈
  67.     These conditionals specify whether the compiler supports particular #pragma's
  68.     
  69.         PRAGMA_IMPORT             - Compiler supports: #pragma import on/off/reset
  70.         PRAGMA_ONCE              - Compiler supports: #pragma once
  71.         PRAGMA_STRUCT_ALIGN      - Compiler supports: #pragma options align=mac68k/power/reset
  72.         PRAGMA_STRUCT_PACK        - Compiler supports: #pragma pack(n)
  73.         PRAGMA_STRUCT_PACKPUSH    - Compiler supports: #pragma pack(push, n)/pack(pop)
  74.         PRAGMA_ENUM_PACK         - Compiler supports: #pragma options(!pack_enums)
  75.         PRAGMA_ENUM_ALWAYSINT     - Compiler supports: #pragma enumsalwaysint on/off/reset
  76.         PRAGMA_ENUM_OPTIONS        - Compiler supports: #pragma options enum=int/small/reset
  77.  
  78.     FOUR_CHAR_CODE
  79.     This conditional does the proper byte swapping to assue that a four character code (e.g. 'TEXT')
  80.     is compiled down to the correct value on all compilers.
  81.  
  82.         FOUR_CHAR_CODE('abcd')    - Convert a four-char-code to the correct 32-bit value
  83.  
  84.     TYPE_≈
  85.     These conditionals specify whether the compiler supports particular types.
  86.  
  87.         TYPE_LONGLONG            - Compiler supports "long long" 64-bit integers
  88.         TYPE_BOOL                - Compiler supports "bool"
  89.         TYPE_EXTENDED            - Compiler supports "extended" 80/96 bit floating point
  90.  
  91. ****************************************************************************************************/
  92.  
  93. #if defined(__MRC__)
  94.     /*
  95.         MrC[pp] compiler from Apple Computer, Inc.
  96.     */
  97.     #define TARGET_CPU_PPC              1
  98.     #define TARGET_CPU_68K              0
  99.     #define TARGET_CPU_X86              0
  100.     #define TARGET_CPU_MIPS             0
  101.     #define TARGET_CPU_SPARC            0        
  102.     #define TARGET_CPU_ALPHA            0
  103.     #define TARGET_OS_MAC                1
  104.     #define TARGET_OS_WIN32                0
  105.     #define TARGET_OS_UNIX                0
  106.     #define TARGET_RT_LITTLE_ENDIAN        0
  107.     #define TARGET_RT_BIG_ENDIAN        1
  108.     #define TARGET_RT_MAC_CFM            1
  109.     #define TARGET_RT_MAC_68881            0
  110.     #if (__MRC__  > 0x0200) && (__MRC__ < 0x0700)
  111.         #define PRAGMA_IMPORT            1
  112.     #else
  113.         #define PRAGMA_IMPORT            0
  114.     #endif
  115.     #define PRAGMA_STRUCT_ALIGN            1
  116.     #define PRAGMA_ONCE                    1
  117.     #define PRAGMA_STRUCT_PACK            0
  118.     #define PRAGMA_STRUCT_PACKPUSH        0
  119.     #define PRAGMA_ENUM_PACK            1
  120.     #define PRAGMA_ENUM_ALWAYSINT        0
  121.     #define PRAGMA_ENUM_OPTIONS            0
  122.     #define FOUR_CHAR_CODE(x)            (x)
  123.         
  124.     #if (__MRC__  > 0x0300) && (__MRC__ < 0x0700)
  125.         #if __option(longlong)
  126.             #define TYPE_LONGLONG        1
  127.         #else
  128.             #define TYPE_LONGLONG        0
  129.         #endif
  130.         #if __option(bool)
  131.             #define TYPE_BOOL            1
  132.         #else
  133.             #define TYPE_BOOL            0
  134.         #endif
  135.     #else
  136.         #define TYPE_LONGLONG            0
  137.         #define TYPE_BOOL                0
  138.     #endif
  139.     #define TYPE_EXTENDED                0
  140.     
  141.  
  142.  
  143. #elif defined(__SC__) && (defined(MPW_CPLUS) || defined(MPW_C))
  144.     /*
  145.         SC[pp] compiler from Apple Computer, Inc.
  146.     */
  147.     #define TARGET_CPU_PPC              0
  148.     #define TARGET_CPU_68K              1
  149.     #define TARGET_CPU_X86              0
  150.     #define TARGET_CPU_MIPS             0
  151.     #define TARGET_CPU_SPARC            0        
  152.     #define TARGET_CPU_ALPHA            0
  153.     #define TARGET_OS_MAC                1
  154.     #define TARGET_OS_WIN32                0
  155.     #define TARGET_OS_UNIX                0
  156.     #define TARGET_RT_LITTLE_ENDIAN        0
  157.     #define TARGET_RT_BIG_ENDIAN        1
  158.     #if defined(__CFM68K__)
  159.         #define TARGET_RT_MAC_CFM        1
  160.     #else
  161.         #define TARGET_RT_MAC_CFM        0
  162.     #endif
  163.     #if defined(mc68881)
  164.         #define TARGET_RT_MAC_68881        1
  165.     #else
  166.         #define TARGET_RT_MAC_68881        0
  167.     #endif
  168.     #if TARGET_RT_MAC_CFM 
  169.         #define PRAGMA_IMPORT            1
  170.         #if (__SC__ <= 0x0810)
  171.             /* old versions of SC don't support “#pragma import reset” */
  172.             #define PRAGMA_IMPORT_OFF    1
  173.         #endif
  174.     #else
  175.         #define PRAGMA_IMPORT            0
  176.     #endif
  177.     #define PRAGMA_STRUCT_ALIGN            0
  178.     #define PRAGMA_ONCE                    0
  179.     #define PRAGMA_STRUCT_PACK            0
  180.     #define PRAGMA_STRUCT_PACKPUSH        0
  181.     #define PRAGMA_ENUM_PACK            1
  182.     #define PRAGMA_ENUM_ALWAYSINT        0
  183.     #define PRAGMA_ENUM_OPTIONS            0
  184.     #define FOUR_CHAR_CODE(x)            (x)
  185.     
  186.     #define TYPE_LONGLONG                0
  187.     #define TYPE_EXTENDED                1
  188.     #if (__SC__  > 0x0810)
  189.         #if __option(bool)
  190.             #define TYPE_BOOL            1
  191.         #else
  192.             #define TYPE_BOOL            0
  193.         #endif
  194.     #else
  195.         #define TYPE_BOOL                0
  196.     #endif
  197.         
  198.  
  199.  
  200. #elif defined(__MWERKS__)
  201.     /*
  202.         CodeWarrior compiler from Metrowerks, Inc.
  203.     */
  204.     #if (__MWERKS__ < 0x0900) || macintosh
  205.         #define TARGET_OS_MAC                1
  206.         #define TARGET_OS_WIN32                0
  207.         #define TARGET_OS_UNIX                0
  208.         #define TARGET_CPU_X86              0
  209.         #define TARGET_CPU_MIPS             0
  210.         #define TARGET_CPU_SPARC            0        
  211.         #define TARGET_CPU_ALPHA            0
  212.         #define TARGET_RT_LITTLE_ENDIAN        0
  213.         #define TARGET_RT_BIG_ENDIAN        1
  214.         #if powerc
  215.             #define TARGET_CPU_PPC          1
  216.             #define TARGET_CPU_68K          0
  217.             #define TARGET_RT_MAC_CFM        1
  218.             #define TARGET_RT_MAC_68881        0
  219.         #else
  220.             #define TARGET_CPU_PPC          0
  221.             #define TARGET_CPU_68K          1
  222.             #if defined(__CFM68K__)
  223.                 #define TARGET_RT_MAC_CFM    1
  224.             #else
  225.                 #define TARGET_RT_MAC_CFM    0
  226.             #endif
  227.             #if __MC68881__
  228.                 #define TARGET_RT_MAC_68881    1
  229.             #else
  230.                 #define TARGET_RT_MAC_68881    0
  231.             #endif
  232.         #endif
  233.         #define PRAGMA_ONCE                    1
  234.         #if (__MWERKS__ >= 0x0700)
  235.             #define PRAGMA_IMPORT            TARGET_RT_MAC_CFM
  236.         #else
  237.             #define PRAGMA_IMPORT            0
  238.         #endif
  239.         #define PRAGMA_STRUCT_ALIGN            1
  240.         #define PRAGMA_STRUCT_PACK            0
  241.         #define PRAGMA_STRUCT_PACKPUSH        0
  242.         #define PRAGMA_ENUM_PACK            0
  243.         #define PRAGMA_ENUM_ALWAYSINT        1
  244.         #define PRAGMA_ENUM_OPTIONS            0
  245.         #define FOUR_CHAR_CODE(x)            (x)
  246.  
  247.     
  248.     #elif (__MWERKS__ >= 0x0900) && __INTEL__
  249.         #define TARGET_CPU_PPC              0
  250.         #define TARGET_CPU_68K              0
  251.         #define TARGET_CPU_X86              1
  252.         #define TARGET_CPU_MIPS             0
  253.         #define TARGET_CPU_SPARC            0        
  254.         #define TARGET_CPU_ALPHA            0
  255.         #define TARGET_OS_MAC                0
  256.         #define TARGET_OS_WIN32                1
  257.         #define TARGET_OS_UNIX                0
  258.         #define TARGET_RT_LITTLE_ENDIAN        1
  259.         #define TARGET_RT_BIG_ENDIAN        0
  260.         #define TARGET_RT_MAC_CFM            0
  261.         #define TARGET_RT_MAC_68881            0
  262.         #define PRAGMA_ONCE                    1
  263.         #define PRAGMA_IMPORT                0
  264.         #define PRAGMA_STRUCT_ALIGN            0
  265.         #define PRAGMA_STRUCT_PACK            1
  266.         #define PRAGMA_STRUCT_PACKPUSH        1
  267.         #define PRAGMA_ENUM_PACK            0
  268.         #define PRAGMA_ENUM_ALWAYSINT        1
  269.         #define PRAGMA_ENUM_OPTIONS            0
  270.         #define FOUR_CHAR_CODE(x)            (x)
  271.  
  272.  
  273.     #elif (__MWERKS__ >= 0x1900) && __MIPS__
  274.         #define TARGET_CPU_PPC              0
  275.         #define TARGET_CPU_68K              0
  276.         #define TARGET_CPU_X86              0
  277.         #define TARGET_CPU_MIPS             1
  278.         #define TARGET_CPU_SPARC            0        
  279.         #define TARGET_CPU_ALPHA            0
  280.         #define TARGET_OS_MAC                0
  281.         #define TARGET_OS_WIN32                0
  282.         #define TARGET_OS_UNIX                1
  283.         #if __option(little_endian)
  284.             #define TARGET_RT_LITTLE_ENDIAN    1
  285.             #define TARGET_RT_BIG_ENDIAN    0
  286.         #else
  287.             #define TARGET_RT_LITTLE_ENDIAN    0
  288.             #define TARGET_RT_BIG_ENDIAN    1
  289.         #endif
  290.         #define TARGET_RT_MAC_CFM            0
  291.         #define TARGET_RT_MAC_68881            0
  292.         #define PRAGMA_ONCE                    1
  293.         #define PRAGMA_IMPORT                0
  294.         #define PRAGMA_STRUCT_ALIGN            0
  295.         #define PRAGMA_STRUCT_PACK            1
  296.         #define PRAGMA_STRUCT_PACKPUSH        0
  297.         #define PRAGMA_ENUM_PACK            0
  298.         #define PRAGMA_ENUM_ALWAYSINT        1
  299.         #define PRAGMA_ENUM_OPTIONS            0
  300.         #define FOUR_CHAR_CODE(x)            (x)
  301.     
  302.     #else    
  303.         #error unknown Metrowerks compiler
  304.     #endif
  305.  
  306.  
  307.     #if (__MWERKS__ >= 0x1100)
  308.         #if __option(longlong)
  309.             #define TYPE_LONGLONG        1
  310.             #define _LONG_LONG            1        /* temporary */
  311.         #else
  312.             #define TYPE_LONGLONG        0
  313.         #endif
  314.     #else
  315.         #define TYPE_LONGLONG            0
  316.     #endif
  317.     #if (__MWERKS__ >= 0x1000)
  318.         #if __option(bool)
  319.             #define TYPE_BOOL            1
  320.         #else
  321.             #define TYPE_BOOL            0
  322.         #endif
  323.     #else
  324.         #define TYPE_BOOL                0
  325.     #endif
  326.  
  327.     #if TARGET_OS_MAC && TARGET_CPU_68K
  328.         typedef long double extended;
  329.         #define TYPE_EXTENDED            1
  330.     #else
  331.         #define TYPE_EXTENDED            0
  332.     #endif
  333.  
  334.  
  335.  
  336. #elif defined(SYMANTEC_CPLUS) || defined(SYMANTEC_C)
  337.     /*
  338.         C and C++ compiler from Symantec, Inc.
  339.     */
  340.     #define TARGET_OS_MAC                1
  341.     #define TARGET_OS_WIN32                0
  342.     #define TARGET_OS_UNIX                0
  343.     #define TARGET_CPU_X86              0
  344.     #define TARGET_CPU_MIPS             0
  345.     #define TARGET_CPU_SPARC            0        
  346.     #define TARGET_CPU_ALPHA            0
  347.     #define TARGET_RT_LITTLE_ENDIAN        0
  348.     #define TARGET_RT_BIG_ENDIAN        1
  349.     #if powerc
  350.         #define TARGET_CPU_PPC          1
  351.         #define TARGET_CPU_68K          0
  352.         #define TARGET_RT_MAC_CFM        1
  353.         #define TARGET_RT_MAC_68881        0
  354.     #else
  355.         #define TARGET_CPU_PPC          0
  356.         #define TARGET_CPU_68K          1
  357.         #if defined(__CFM68K)
  358.             #define TARGET_RT_MAC_CFM    1
  359.         #else
  360.             #define TARGET_RT_MAC_CFM    0
  361.         #endif
  362.         #if mc68881
  363.             #define TARGET_RT_MAC_68881    1
  364.         #else
  365.             #define TARGET_RT_MAC_68881    0
  366.         #endif
  367.     #endif
  368.     #define PRAGMA_IMPORT                0
  369.     #define PRAGMA_ONCE                    1
  370.     #define PRAGMA_STRUCT_ALIGN            1
  371.     #define PRAGMA_STRUCT_PACK            0
  372.     #define PRAGMA_STRUCT_PACKPUSH        0
  373.     #define PRAGMA_ENUM_PACK            1
  374.     #define PRAGMA_ENUM_ALWAYSINT        0
  375.     #define PRAGMA_ENUM_OPTIONS            0
  376.     #define FOUR_CHAR_CODE(x)            (x)
  377.     
  378.     #if __useAppleExts__
  379.         #define TYPE_EXTENDED            1
  380.     #else
  381.         #define TYPE_EXTENDED            0
  382.     #endif
  383.     #define TYPE_LONGLONG                0
  384.     #define TYPE_BOOL                    0
  385.     
  386.  
  387.  
  388. #elif defined(THINK_C)
  389.     /*
  390.         THINK C compiler from Symantec, Inc.        << WARNING: Unsupported Compiler >>
  391.     */
  392.     #define TARGET_CPU_PPC              0
  393.     #define TARGET_CPU_68K              1
  394.     #define TARGET_CPU_X86              0
  395.     #define TARGET_CPU_MIPS             0
  396.     #define TARGET_CPU_SPARC            0        
  397.     #define TARGET_CPU_ALPHA            0
  398.     #define TARGET_OS_MAC                1
  399.     #define TARGET_OS_WIN32                0
  400.     #define TARGET_OS_UNIX                0
  401.     #define TARGET_RT_LITTLE_ENDIAN        0
  402.     #define TARGET_RT_BIG_ENDIAN        1
  403.     #define TARGET_RT_MAC_CFM            0
  404.     #if defined(mc68881)
  405.         #define TARGET_RT_MAC_68881        1
  406.     #else
  407.         #define TARGET_RT_MAC_68881        0
  408.     #endif
  409.     #define PRAGMA_IMPORT                0
  410.     #define PRAGMA_STRUCT_ALIGN            0
  411.     #define PRAGMA_ONCE                    1
  412.     #define PRAGMA_STRUCT_PACK            0
  413.     #define PRAGMA_STRUCT_PACKPUSH        0
  414.     #define PRAGMA_ENUM_PACK            1
  415.     #define PRAGMA_ENUM_ALWAYSINT        0
  416.     #define PRAGMA_ENUM_OPTIONS            0
  417.     #define FOUR_CHAR_CODE(x)            (x)
  418.     
  419.     #define TYPE_EXTENDED                1
  420.     #define TYPE_LONGLONG                0
  421.     #define TYPE_BOOL                    0
  422.     
  423.  
  424.  
  425. #elif defined(__PPCC__)
  426.     /*
  427.         PPCC compiler from Apple Computer, Inc.        << WARNING: Unsupported Compiler >>
  428.     */
  429.     #define TARGET_CPU_PPC              1
  430.     #define TARGET_CPU_68K              0
  431.     #define TARGET_CPU_X86              0
  432.     #define TARGET_CPU_MIPS             0
  433.     #define TARGET_CPU_SPARC            0        
  434.     #define TARGET_CPU_ALPHA            0
  435.     #define TARGET_OS_MAC                1
  436.     #define TARGET_OS_WIN32                0
  437.     #define TARGET_OS_UNIX                0
  438.     #define TARGET_RT_LITTLE_ENDIAN        0
  439.     #define TARGET_RT_BIG_ENDIAN        1
  440.     #define TARGET_RT_MAC_CFM            1
  441.     #define TARGET_RT_MAC_68881            0
  442.     #define PRAGMA_IMPORT                0
  443.     #define PRAGMA_STRUCT_ALIGN            1
  444.     #define PRAGMA_ONCE                    0
  445.     #define PRAGMA_STRUCT_PACK            0
  446.     #define PRAGMA_STRUCT_PACKPUSH        0
  447.     #define PRAGMA_ENUM_PACK            0
  448.     #define PRAGMA_ENUM_ALWAYSINT        0
  449.     #define PRAGMA_ENUM_OPTIONS            0
  450.     #define FOUR_CHAR_CODE(x)            (x)
  451.     
  452.     #define TYPE_EXTENDED                0
  453.     #define TYPE_LONGLONG                0
  454.     #define TYPE_BOOL                    0
  455.  
  456.  
  457. #elif defined(applec) && !defined(__SC__)
  458.     /*
  459.         MPW C compiler from Apple Computer, Inc.    << WARNING: Unsupported Compiler >>
  460.     */
  461.     #define TARGET_CPU_PPC              0
  462.     #define TARGET_CPU_68K              1
  463.     #define TARGET_CPU_X86              0
  464.     #define TARGET_CPU_MIPS             0
  465.     #define TARGET_CPU_SPARC            0        
  466.     #define TARGET_CPU_ALPHA            0
  467.     #define TARGET_OS_MAC                1
  468.     #define TARGET_OS_WIN32                0
  469.     #define TARGET_OS_UNIX                0
  470.     #define TARGET_RT_LITTLE_ENDIAN        0
  471.     #define TARGET_RT_BIG_ENDIAN        1
  472.     #define TARGET_RT_MAC_CFM            0
  473.     #if defined(mc68881)
  474.         #define TARGET_RT_MAC_68881        1
  475.     #else
  476.         #define TARGET_RT_MAC_68881        0
  477.     #endif
  478.     #define PRAGMA_IMPORT                0
  479.     #define PRAGMA_STRUCT_ALIGN            0
  480.     #define PRAGMA_ONCE                    0
  481.     #define PRAGMA_STRUCT_PACK            0
  482.     #define PRAGMA_STRUCT_PACKPUSH        0
  483.     #define PRAGMA_ENUM_PACK            0
  484.     #define PRAGMA_ENUM_ALWAYSINT        0
  485.     #define PRAGMA_ENUM_OPTIONS            0
  486.     /* Note: MPW C 3.2 had a bug where MACRO('xx   ') would cause 'xx  ' to be misevaluated */
  487.     #define FOUR_CHAR_CODE                
  488.  
  489.     #define TYPE_EXTENDED                1
  490.     #define TYPE_LONGLONG                0
  491.     #define TYPE_BOOL                    0
  492.  
  493.  
  494.  
  495. #elif defined(__GNUC__) && (defined(__APPLE_CPP__) || defined(__NEXT_CPP__))
  496.     /*
  497.         gcc from Next, Inc., with cpp-precomp (header precompiler)
  498.     */
  499.     #if defined(powerpc) || defined(ppc)
  500.         #define TARGET_CPU_PPC            1
  501.         #define TARGET_CPU_68K            0
  502.         #define TARGET_CPU_X86            0
  503.         #define TARGET_CPU_MIPS            0
  504.         #define TARGET_CPU_SPARC        0   
  505.         #define TARGET_CPU_ALPHA        0
  506.         #define TARGET_RT_MAC_CFM        0
  507.         #define TARGET_RT_MAC_68881        0
  508.         #define TARGET_RT_LITTLE_ENDIAN    0
  509.         #define TARGET_RT_BIG_ENDIAN    1
  510.     #elif defined(m68k)
  511.         #define TARGET_CPU_PPC            0
  512.         #define TARGET_CPU_68K            1
  513.         #define TARGET_CPU_X86            0
  514.         #define TARGET_CPU_MIPS            0
  515.         #define TARGET_CPU_SPARC        0   
  516.         #define TARGET_CPU_ALPHA        0
  517.         #define TARGET_RT_MAC_CFM        0
  518.         #define TARGET_RT_MAC_68881        0
  519.         #define TARGET_RT_LITTLE_ENDIAN 0
  520.         #define TARGET_RT_BIG_ENDIAN    1
  521.     #elif defined(sparc)
  522.         #define TARGET_CPU_PPC            0
  523.         #define TARGET_CPU_68K            0
  524.         #define TARGET_CPU_X86            0
  525.         #define TARGET_CPU_MIPS            0
  526.         #define TARGET_CPU_SPARC        1
  527.         #define TARGET_CPU_ALPHA        0
  528.         #define TARGET_RT_MAC_CFM        0
  529.         #define TARGET_RT_MAC_68881        0
  530.         #define TARGET_RT_LITTLE_ENDIAN    0
  531.         #define TARGET_RT_BIG_ENDIAN    1
  532.     #elif defined(i386) || defined(intel)
  533.         #define TARGET_CPU_PPC            0
  534.         #define TARGET_CPU_68K            0
  535.         #define TARGET_CPU_X86            1
  536.         #define TARGET_CPU_MIPS            0
  537.         #define TARGET_CPU_SPARC        0
  538.         #define TARGET_CPU_ALPHA        0
  539.         #define TARGET_RT_MAC_CFM        0
  540.         #define TARGET_RT_MAC_68881        0
  541.         #define TARGET_RT_LITTLE_ENDIAN    1
  542.         #define TARGET_RT_BIG_ENDIAN    0
  543.     #else
  544.         #error unrecognized NeXT GNU C compiler
  545.     #endif
  546.  
  547.  
  548.     #define TARGET_OS_MAC                0
  549.     #define TARGET_OS_WIN32                0
  550.     #define TARGET_OS_UNIX                1
  551.     #define PRAGMA_IMPORT                0
  552.     #define PRAGMA_STRUCT_ALIGN            1
  553.     #define PRAGMA_ONCE                    0
  554.     #define PRAGMA_STRUCT_PACK            0
  555.     #define PRAGMA_STRUCT_PACKPUSH        0
  556.     #define PRAGMA_ENUM_PACK            0
  557.     #define PRAGMA_ENUM_ALWAYSINT        0
  558.     #define PRAGMA_ENUM_OPTIONS            0
  559.     #define FOUR_CHAR_CODE(x)            (x)
  560.  
  561.     #define TYPE_EXTENDED                0
  562.     #ifdef _LONG_LONG
  563.         #define TYPE_LONGLONG            1
  564.     #else
  565.         #define TYPE_LONGLONG            0
  566.     #endif
  567.     #define TYPE_BOOL                    0
  568.  
  569.  
  570. #elif defined(__GNUC__)
  571.     /*
  572.         gC for MPW from Free Software Foundation, Inc.
  573.     */
  574.     #if #cpu(powerpc)
  575.         #define TARGET_CPU_PPC          1
  576.         #define TARGET_CPU_68K          0
  577.         #define TARGET_CPU_X86          0
  578.         #define TARGET_CPU_MIPS         0
  579.         #define TARGET_CPU_SPARC        0    
  580.         #define TARGET_CPU_ALPHA        0
  581.         #define TARGET_RT_MAC_CFM        1
  582.         #define TARGET_RT_MAC_68881        0
  583.     #elif #cpu(m68k)
  584.         #define TARGET_CPU_PPC          0
  585.         #define TARGET_CPU_68K          1
  586.         #define TARGET_CPU_X86          0
  587.         #define TARGET_CPU_MIPS         0
  588.         #define TARGET_CPU_SPARC        0    
  589.         #define TARGET_CPU_ALPHA        0
  590.         #define TARGET_RT_MAC_CFM        0
  591.         #define TARGET_RT_MAC_68881        0
  592.     #else
  593.         #error unsupported GNU C compiler
  594.     #endif
  595.     
  596.     #if #system(macos)
  597.         #define TARGET_OS_MAC            1
  598.         #define TARGET_OS_WIN32            0
  599.         #define TARGET_OS_UNIX            0
  600.     #elif #system(unix)
  601.         #define TARGET_OS_MAC            0
  602.         #define TARGET_OS_WIN32            0
  603.         #define TARGET_OS_UNIX            1
  604.     #else
  605.         #error unsupported GNU C compiler
  606.     #endif
  607.     
  608.     #define TARGET_RT_LITTLE_ENDIAN        0
  609.     #define TARGET_RT_BIG_ENDIAN        1
  610.     #define PRAGMA_IMPORT                0
  611.     #define PRAGMA_STRUCT_ALIGN            1
  612.     #define PRAGMA_ONCE                    0
  613.     #define PRAGMA_STRUCT_PACK            0
  614.     #define PRAGMA_STRUCT_PACKPUSH        0
  615.     #define PRAGMA_ENUM_PACK            0
  616.     #define PRAGMA_ENUM_ALWAYSINT        0
  617.     #define PRAGMA_ENUM_OPTIONS            0
  618.     #define FOUR_CHAR_CODE(x)            (x)
  619.  
  620.     #define TYPE_EXTENDED                0
  621.     #ifdef _LONG_LONG
  622.         #define TYPE_LONGLONG            1
  623.     #else
  624.         #define TYPE_LONGLONG            0
  625.     #endif
  626.     #define TYPE_BOOL                    0
  627.  
  628.  
  629.  
  630. #elif defined(__xlc) || defined(__xlC) || defined(__xlC__) || defined(__XLC121__)
  631.     /*
  632.         xlc and xlC on RS/6000 from IBM, Inc.
  633.     */
  634.     #define TARGET_CPU_PPC              1
  635.     #define TARGET_CPU_68K              0
  636.     #define TARGET_CPU_X86              0
  637.     #define TARGET_CPU_MIPS             0
  638.     #define TARGET_CPU_SPARC            0        
  639.     #define TARGET_CPU_ALPHA            0
  640.     #if defined(_AIX)
  641.         #define TARGET_OS_MAC            0
  642.         #define TARGET_OS_UNIX            1
  643.     #else
  644.         #define TARGET_OS_MAC            1
  645.         #define TARGET_OS_UNIX            0
  646.     #endif
  647.     #define TARGET_OS_WIN32                0
  648.     #define TARGET_RT_LITTLE_ENDIAN        0
  649.     #define TARGET_RT_BIG_ENDIAN        1
  650.     #define TARGET_RT_MAC_CFM            1
  651.     #define TARGET_RT_MAC_68881            0
  652.     #define PRAGMA_IMPORT                0
  653.     #define PRAGMA_STRUCT_ALIGN            1
  654.     #define PRAGMA_ONCE                    0
  655.     #define PRAGMA_STRUCT_PACK            0
  656.     #define PRAGMA_STRUCT_PACKPUSH        0
  657.     #define PRAGMA_ENUM_PACK            0
  658.     #define PRAGMA_ENUM_ALWAYSINT        0
  659.     #define PRAGMA_ENUM_OPTIONS            1
  660.     #define FOUR_CHAR_CODE(x)            (x)
  661.  
  662.     #define TYPE_EXTENDED                0
  663.     #ifdef _LONG_LONG
  664.         #define TYPE_LONGLONG            1
  665.     #else
  666.         #define TYPE_LONGLONG            0
  667.     #endif
  668.     #define TYPE_BOOL                    0
  669.  
  670.  
  671. #elif defined(_MSC_VER) && !defined(__MWERKS__) 
  672.     /*
  673.         Visual C++ from Microsoft, Inc.
  674.     */
  675.     #if defined(_M_M68K)    /* Visual C++ with Macintosh 68K target */
  676.         #define TARGET_CPU_PPC              0
  677.         #define TARGET_CPU_68K              1
  678.         #define TARGET_CPU_X86              0
  679.         #define TARGET_CPU_MIPS             0
  680.         #define TARGET_CPU_SPARC            0
  681.         #define TARGET_CPU_ALPHA            0
  682.         #define TARGET_OS_MAC                1
  683.         #define TARGET_OS_WIN32                0
  684.         #define TARGET_OS_UNIX                0
  685.         #define TARGET_RT_LITTLE_ENDIAN        0
  686.         #define TARGET_RT_BIG_ENDIAN        1
  687.         #define TARGET_RT_MAC_CFM            0
  688.         #define TARGET_RT_MAC_68881            0
  689.         #define PRAGMA_IMPORT                0
  690.         #define PRAGMA_STRUCT_ALIGN            1
  691.         #define PRAGMA_ONCE                     0
  692.         #define PRAGMA_STRUCT_PACK            1
  693.         #define PRAGMA_STRUCT_PACKPUSH        1
  694.         #define PRAGMA_ENUM_PACK            0
  695.         #define PRAGMA_ENUM_ALWAYSINT        0
  696.         #define PRAGMA_ENUM_OPTIONS            0
  697.         #define FOUR_CHAR_CODE(x)            (x)
  698.         #define TYPE_EXTENDED                0
  699.         #define TYPE_LONGLONG                0
  700.         #define TYPE_BOOL                    0
  701.     #elif defined(_M_MPPC)    /* Visual C++ with Macintosh PowerPC target */
  702.         #define TARGET_CPU_PPC              1
  703.         #define TARGET_CPU_68K              0
  704.         #define TARGET_CPU_X86              0
  705.         #define TARGET_CPU_MIPS             0
  706.         #define TARGET_CPU_SPARC            0
  707.         #define TARGET_CPU_ALPHA            0
  708.         #define TARGET_OS_MAC                1
  709.         #define TARGET_OS_WIN32                0
  710.         #define TARGET_OS_UNIX                0
  711.         #define TARGET_RT_LITTLE_ENDIAN        0
  712.         #define TARGET_RT_BIG_ENDIAN        1
  713.         #define TARGET_RT_MAC_CFM            1
  714.         #define TARGET_RT_MAC_68881            0
  715.         #define PRAGMA_IMPORT                0
  716.         #define PRAGMA_STRUCT_ALIGN            1
  717.         #define PRAGMA_ONCE                     0
  718.         #define PRAGMA_STRUCT_PACK            1
  719.         #define PRAGMA_STRUCT_PACKPUSH        1
  720.         #define PRAGMA_ENUM_PACK            0
  721.         #define PRAGMA_ENUM_ALWAYSINT        0
  722.         #define PRAGMA_ENUM_OPTIONS            0
  723.         #define FOUR_CHAR_CODE(x)            (x)
  724.         #define TYPE_EXTENDED                0
  725.         #define TYPE_LONGLONG                0
  726.         #define TYPE_BOOL                    0
  727.  
  728.     #elif defined(_M_IX86)    /* Visual C++ with Intel x86 target */
  729.         #define TARGET_CPU_PPC              0
  730.         #define TARGET_CPU_68K              0
  731.         #define TARGET_CPU_X86              1
  732.         #define TARGET_CPU_MIPS             0
  733.         #define TARGET_CPU_SPARC            0
  734.         #define TARGET_CPU_ALPHA            0
  735.         #define TARGET_OS_MAC                0
  736.         #define TARGET_OS_WIN32                1
  737.         #define TARGET_OS_UNIX                0
  738.         #define TARGET_RT_LITTLE_ENDIAN        1
  739.         #define TARGET_RT_BIG_ENDIAN        0
  740.         #define TARGET_RT_MAC_CFM            0
  741.         #define TARGET_RT_MAC_68881            0
  742.         #define PRAGMA_IMPORT                0
  743.         #define PRAGMA_STRUCT_ALIGN            0
  744.         #define PRAGMA_ONCE                     0
  745.         #define PRAGMA_STRUCT_PACK            1
  746.         #define PRAGMA_STRUCT_PACKPUSH        1
  747.         #define PRAGMA_ENUM_PACK            0
  748.         #define PRAGMA_ENUM_ALWAYSINT        0
  749.         #define PRAGMA_ENUM_OPTIONS            0
  750.         #define FOUR_CHAR_CODE(x)            (x) 
  751.         #define TYPE_EXTENDED                0
  752.         #define TYPE_LONGLONG                0
  753.         #if defined(__cplusplus) && (_MSC_VER >= 1100)
  754.             #define TYPE_BOOL                1
  755.         #else
  756.             #define TYPE_BOOL                0
  757.         #endif
  758.  
  759.         #elif defined(_M_ALPHA)        /* Visual C++ with Dec Alpha target */
  760.         #define TARGET_CPU_PPC              0
  761.         #define TARGET_CPU_68K              0
  762.         #define TARGET_CPU_X86              0
  763.         #define TARGET_CPU_MIPS             0
  764.         #define TARGET_CPU_SPARC            0
  765.         #define TARGET_CPU_ALPHA            1
  766.         #define TARGET_OS_MAC                0
  767.         #define TARGET_OS_WIN32                1
  768.         #define TARGET_OS_UNIX                0
  769.         #define TARGET_RT_LITTLE_ENDIAN        1
  770.         #define TARGET_RT_BIG_ENDIAN        0
  771.         #define TARGET_RT_MAC_CFM            0
  772.         #define TARGET_RT_MAC_68881            0
  773.         #define PRAGMA_IMPORT                0
  774.         #define PRAGMA_STRUCT_ALIGN            0
  775.         #define PRAGMA_ONCE                     0
  776.         #define PRAGMA_STRUCT_PACK            1
  777.         #define PRAGMA_STRUCT_PACKPUSH        1
  778.         #define PRAGMA_ENUM_PACK            0
  779.         #define PRAGMA_ENUM_ALWAYSINT        0
  780.         #define PRAGMA_ENUM_OPTIONS            0
  781.         #define FOUR_CHAR_CODE(x)        (((DWORD) ((x) & 0x000000FF)) << 24) \
  782.                                     | (((DWORD) ((x) & 0x0000FF00)) << 8) \
  783.                                     | (((DWORD) ((x) & 0x00FF0000)) >> 8) \
  784.                                     | (((DWORD) ((x) & 0xFF000000)) >> 24)
  785.         #define TYPE_EXTENDED                0
  786.         #define TYPE_LONGLONG                0
  787.         #define TYPE_BOOL                    0
  788.  
  789.     #elif defined(_M_PPC)    /* Visual C++ for Windows NT on PowerPC target */
  790.         #define TARGET_CPU_PPC              1
  791.         #define TARGET_CPU_68K              0
  792.         #define TARGET_CPU_X86              0
  793.         #define TARGET_CPU_MIPS             0
  794.         #define TARGET_CPU_SPARC            0
  795.         #define TARGET_CPU_ALPHA            0
  796.         #define TARGET_OS_MAC                0
  797.         #define TARGET_OS_WIN32                1
  798.         #define TARGET_OS_UNIX                0
  799.         #define TARGET_RT_LITTLE_ENDIAN        1
  800.         #define TARGET_RT_BIG_ENDIAN        0
  801.         #define TARGET_RT_MAC_CFM            0
  802.         #define TARGET_RT_MAC_68881            0
  803.         #define PRAGMA_IMPORT                0
  804.         #define PRAGMA_STRUCT_ALIGN            0
  805.         #define PRAGMA_ONCE                     0
  806.         #define PRAGMA_STRUCT_PACK            1
  807.         #define PRAGMA_STRUCT_PACKPUSH        1
  808.         #define PRAGMA_ENUM_PACK            0
  809.         #define PRAGMA_ENUM_ALWAYSINT        0
  810.         #define PRAGMA_ENUM_OPTIONS            0
  811.         #define FOUR_CHAR_CODE(x)        (((DWORD) ((x) & 0x000000FF)) << 24) \
  812.                                     | (((DWORD) ((x) & 0x0000FF00)) << 8) \
  813.                                     | (((DWORD) ((x) & 0x00FF0000)) >> 8) \
  814.                                     | (((DWORD) ((x) & 0xFF000000)) >> 24)
  815.         #define TYPE_EXTENDED                0
  816.         #define TYPE_LONGLONG                0
  817.         #define TYPE_BOOL                    0
  818.  
  819.         #elif defined(_M_MRX000)    /* Visual C++ for Windows NT on MIPS target */
  820.         #define TARGET_CPU_PPC              0
  821.         #define TARGET_CPU_68K              0
  822.         #define TARGET_CPU_X86              0
  823.         #define TARGET_CPU_MIPS             1
  824.         #define TARGET_CPU_SPARC            0
  825.         #define TARGET_CPU_ALPHA            0
  826.         #define TARGET_OS_MAC                0
  827.         #define TARGET_OS_WIN32                1
  828.         #define TARGET_OS_UNIX                0
  829.         #define TARGET_RT_LITTLE_ENDIAN        1
  830.         #define TARGET_RT_BIG_ENDIAN        0
  831.         #define TARGET_RT_MAC_CFM            0
  832.         #define TARGET_RT_MAC_68881            0
  833.         #define PRAGMA_IMPORT                0
  834.         #define PRAGMA_STRUCT_ALIGN            0
  835.         #define PRAGMA_ONCE                     0
  836.         #define PRAGMA_STRUCT_PACK            1
  837.         #define PRAGMA_STRUCT_PACKPUSH        1
  838.         #define PRAGMA_ENUM_PACK            0
  839.         #define PRAGMA_ENUM_ALWAYSINT        0
  840.         #define PRAGMA_ENUM_OPTIONS            0
  841.         #define FOUR_CHAR_CODE(x)        (((DWORD) ((x) & 0x000000FF)) << 24) \
  842.                                     | (((DWORD) ((x) & 0x0000FF00)) << 8) \
  843.                                     | (((DWORD) ((x) & 0x00FF0000)) >> 8) \
  844.                                     | (((DWORD) ((x) & 0xFF000000)) >> 24)
  845.         #define TYPE_EXTENDED                0
  846.         #define TYPE_LONGLONG                0
  847.         #define TYPE_BOOL                    0
  848.     #endif
  849.  
  850.  
  851. #elif defined(__MOTO__)
  852.     /*
  853.         mcc from Motorola, Inc. 
  854.     */
  855.     #define TARGET_CPU_PPC              1
  856.     #define TARGET_CPU_68K              0
  857.     #define TARGET_CPU_X86              0
  858.     #define TARGET_CPU_MIPS             0
  859.     #define TARGET_CPU_SPARC            0        
  860.     #define TARGET_CPU_ALPHA            0
  861.     #define TARGET_OS_MAC                1
  862.     #define TARGET_OS_WIN32                0
  863.     #define TARGET_OS_UNIX                0
  864.     #define TARGET_RT_LITTLE_ENDIAN        0
  865.     #define TARGET_RT_BIG_ENDIAN        1
  866.     #define TARGET_RT_MAC_CFM            1
  867.     #define TARGET_RT_MAC_68881            0
  868.     #define PRAGMA_IMPORT                0            /* how is this detected ?? */
  869.     #define PRAGMA_STRUCT_ALIGN            1
  870.     #if __MOTO__ >= 40702                             /* MCC version 4.7.2 */
  871.       #define PRAGMA_ONCE                 1
  872.     #else
  873.       #define PRAGMA_ONCE                 0
  874.     #endif
  875.     #define PRAGMA_STRUCT_PACK            0
  876.     #define PRAGMA_STRUCT_PACKPUSH        0
  877.     #define PRAGMA_ENUM_PACK            0
  878.     #define PRAGMA_ENUM_ALWAYSINT        0
  879.     #define PRAGMA_ENUM_OPTIONS            0
  880.     #define FOUR_CHAR_CODE(x)            (x)
  881.     #define TYPE_LONGLONG                0            /* how is this detected ?? */
  882.     #ifdef _BOOL
  883.         #define TYPE_BOOL                1            
  884.     #else
  885.         #define TYPE_BOOL                0            
  886.     #endif
  887.     #define TYPE_EXTENDED                0
  888.  
  889.  
  890.  
  891. #elif defined(_MIPS_ISA)
  892.     /*
  893.         MIPSpro compiler from Silicon Graphics Inc.
  894.     */
  895.     #define TARGET_CPU_PPC              0
  896.     #define TARGET_CPU_68K              0
  897.     #define TARGET_CPU_X86              0
  898.     #define TARGET_CPU_MIPS             1
  899.     #define TARGET_CPU_SPARC            0        
  900.     #define TARGET_CPU_ALPHA            0
  901.     #define TARGET_OS_MAC                0
  902.     #define TARGET_OS_WIN32                0
  903.     #define TARGET_OS_UNIX                1
  904.     #define TARGET_RT_LITTLE_ENDIAN        0
  905.     #define TARGET_RT_BIG_ENDIAN        1
  906.     #define TARGET_RT_MAC_CFM            0
  907.     #define TARGET_RT_MAC_68881            0
  908.     #define PRAGMA_IMPORT                0
  909.     #define PRAGMA_STRUCT_ALIGN            0
  910.     #define PRAGMA_ONCE                    0
  911.     #define PRAGMA_STRUCT_PACK            1
  912.     #define PRAGMA_STRUCT_PACKPUSH        0
  913.     #define PRAGMA_ENUM_PACK            0
  914.     #define PRAGMA_ENUM_ALWAYSINT        0
  915.     #define PRAGMA_ENUM_OPTIONS            0
  916.     #define FOUR_CHAR_CODE(x)            (x)
  917.     #define TYPE_EXTENDED                0
  918.     #define TYPE_LONGLONG                0
  919.     #define TYPE_BOOL                    0
  920.  
  921.  
  922. #elif defined(__sparc)
  923.     /*
  924.         SPARCompiler compiler from Sun Microsystems Inc.
  925.     */
  926.     #define TARGET_CPU_PPC              0
  927.     #define TARGET_CPU_68K              0
  928.     #define TARGET_CPU_X86              0
  929.     #define TARGET_CPU_MIPS             0
  930.     #define TARGET_CPU_SPARC            1        
  931.     #define TARGET_CPU_ALPHA            0
  932.     #define TARGET_OS_MAC                0
  933.     #define TARGET_OS_WIN32                0
  934.     #define TARGET_OS_UNIX                1
  935.     #define TARGET_RT_LITTLE_ENDIAN        0
  936.     #define TARGET_RT_BIG_ENDIAN        1
  937.     #define TARGET_RT_MAC_CFM            0
  938.     #define TARGET_RT_MAC_68881            0
  939.     #define PRAGMA_IMPORT                0
  940.     #define PRAGMA_STRUCT_ALIGN            0
  941.     #define PRAGMA_ONCE                    0
  942.     #define PRAGMA_STRUCT_PACK            1
  943.     #define PRAGMA_STRUCT_PACKPUSH        0
  944.     #define PRAGMA_ENUM_PACK            0
  945.     #define PRAGMA_ENUM_ALWAYSINT        0
  946.     #define PRAGMA_ENUM_OPTIONS            0
  947.     #define FOUR_CHAR_CODE(x)        (((unsigned long) ((x) & 0x000000FF)) << 24) \
  948.                                     | (((unsigned long) ((x) & 0x0000FF00)) << 8) \
  949.                                     | (((unsigned long) ((x) & 0x00FF0000)) >> 8) \
  950.                                     | (((unsigned long) ((x) & 0xFF000000)) >> 24)
  951.     #define TYPE_EXTENDED                0
  952.     #define TYPE_LONGLONG                0
  953.     #define TYPE_BOOL                    0
  954.  
  955.  
  956. #else
  957.     /*
  958.         Unknown compiler, perhaps set up from the command line (e.g. -d TARGET_CPU_MIPS , etc.)
  959.     */
  960.     #if defined(TARGET_CPU_PPC) && TARGET_CPU_PPC
  961.         #define TARGET_CPU_68K   0
  962.         #define TARGET_CPU_X86   0
  963.         #define TARGET_CPU_MIPS  0
  964.         #define TARGET_CPU_SPARC 0
  965.         #define TARGET_CPU_ALPHA 0
  966.     #elif defined(TARGET_CPU_68K) && TARGET_CPU_68K
  967.         #define TARGET_CPU_PPC   0
  968.         #define TARGET_CPU_X86   0
  969.         #define TARGET_CPU_MIPS  0
  970.         #define TARGET_CPU_SPARC 0
  971.         #define TARGET_CPU_ALPHA 0
  972.     #elif defined(TARGET_CPU_X86) && TARGET_CPU_X86
  973.         #define TARGET_CPU_PPC   0
  974.         #define TARGET_CPU_68K   0
  975.         #define TARGET_CPU_MIPS  0
  976.         #define TARGET_CPU_SPARC 0
  977.         #define TARGET_CPU_ALPHA 0
  978.     #elif defined(TARGET_CPU_MIPS) && TARGET_CPU_MIPS
  979.         #define TARGET_CPU_PPC   0
  980.         #define TARGET_CPU_68K   0
  981.         #define TARGET_CPU_X86   0
  982.         #define TARGET_CPU_SPARC 0
  983.         #define TARGET_CPU_ALPHA 0
  984.     #elif defined(TARGET_CPU_SPARC) && TARGET_CPU_SPARC
  985.         #define TARGET_CPU_PPC   0
  986.         #define TARGET_CPU_68K   0
  987.         #define TARGET_CPU_X86   0
  988.         #define TARGET_CPU_MIPS  0
  989.         #define TARGET_CPU_ALPHA 0
  990.     #elif defined(TARGET_CPU_ALPHA) && TARGET_CPU_ALPHA
  991.         #define TARGET_CPU_PPC   0
  992.         #define TARGET_CPU_68K   0
  993.         #define TARGET_CPU_X86   0
  994.         #define TARGET_CPU_MIPS  0
  995.         #define TARGET_CPU_SPARC 0
  996.  
  997.         
  998.     #else
  999.         /*
  1000.             NOTE:    If your compiler errors out here then support for your compiler 
  1001.                     has not yet been added to ConditionalMacros.h.  
  1002.                     
  1003.                     ConditionalMacros.h is designed to be plug-and-play.  It auto detects
  1004.                     which compiler is being run and configures the TARGET_ conditionals
  1005.                     appropriately.  
  1006.                     
  1007.                     The short term work around is to set the TARGET_CPU_ and TARGET_OS_
  1008.                     on the command line to the compiler (e.g. d TARGET_CPU_MIPS -d TARGET_OS_UNIX)
  1009.                     
  1010.                     The long term solution is to add a new case to this file which
  1011.                     auto detects your compiler and sets up the TARGET_ conditionals.
  1012.                     If you do this, send the changes you made to devsupport@apple.com
  1013.                     to get it integrated into the next release of ConditionalMacros.h.
  1014.         */
  1015.         #error ConditionalMacros.h: unknown compiler (see comment above)
  1016.         #define TARGET_CPU_PPC   0
  1017.         #define TARGET_CPU_68K   0
  1018.         #define TARGET_CPU_X86   0
  1019.         #define TARGET_CPU_MIPS  0
  1020.         #define TARGET_CPU_SPARC 0
  1021.         #define TARGET_CPU_ALPHA 0
  1022.     #endif
  1023.     
  1024.  
  1025.  
  1026.     #if defined(TARGET_OS_MAC) && TARGET_OS_MAC
  1027.         #define TARGET_OS_WIN32  0
  1028.         #define TARGET_OS_UNIX   0
  1029.     #elif defined(TARGET_OS_WIN32) && TARGET_OS_WIN32
  1030.         #define TARGET_OS_MAC    0
  1031.         #define TARGET_OS_UNIX   0
  1032.     #elif defined(TARGET_OS_UNIX) && TARGET_OS_UNIX
  1033.         #define TARGET_OS_MAC    0
  1034.         #define TARGET_OS_WIN32  0
  1035.     #elif TARGET_CPU_PPC || TARGET_CPU_68K
  1036.         #define TARGET_OS_MAC    1
  1037.         #define TARGET_OS_WIN32  0
  1038.         #define TARGET_OS_UNIX   0
  1039.     #else
  1040.         #error ConditionalMacros.h: unknown target OS (see comment above)
  1041.     #endif
  1042.  
  1043.     #if !defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
  1044.         #if TARGET_OS_MAC
  1045.             #define TARGET_RT_LITTLE_ENDIAN        0
  1046.             #define TARGET_RT_BIG_ENDIAN        1
  1047.         #elif TARGET_OS_WIN32
  1048.             #define TARGET_RT_LITTLE_ENDIAN        1
  1049.             #define TARGET_RT_BIG_ENDIAN        0
  1050.         #endif
  1051.     #endif
  1052.         
  1053.     #if defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
  1054.         #define TARGET_RT_LITTLE_ENDIAN        !TARGET_RT_BIG_ENDIAN
  1055.     #elif !defined(TARGET_RT_BIG_ENDIAN) && defined(TARGET_RT_LITTLE_ENDIAN)
  1056.         #define TARGET_RT_BIG_ENDIAN        !TARGET_RT_LITTLE_ENDIAN
  1057.     #endif
  1058.     
  1059.     #if !defined(TARGET_RT_BIG_ENDIAN) && !defined(TARGET_RT_LITTLE_ENDIAN)
  1060.         #error unknown endianess of target processor
  1061.     #endif
  1062.  
  1063.     #ifndef TARGET_RT_MAC_CFM
  1064.     #define TARGET_RT_MAC_CFM            TARGET_CPU_PPC
  1065.     #endif
  1066.     #ifndef TARGET_RT_MAC_68881
  1067.     #define TARGET_RT_MAC_68881            0
  1068.     #endif
  1069.  
  1070.         
  1071.     #ifndef PRAGMA_IMPORT
  1072.     #define PRAGMA_IMPORT                0
  1073.     #endif
  1074.     #ifndef PRAGMA_STRUCT_ALIGN
  1075.     #define PRAGMA_STRUCT_ALIGN            0
  1076.     #endif
  1077.     #ifndef PRAGMA_ONCE
  1078.     #define PRAGMA_ONCE                    0
  1079.     #endif
  1080.     #ifndef PRAGMA_STRUCT_PACK
  1081.     #define PRAGMA_STRUCT_PACK            0
  1082.     #endif
  1083.     #ifndef PRAGMA_STRUCT_PACKPUSH
  1084.     #define PRAGMA_STRUCT_PACKPUSH        0
  1085.     #endif
  1086.     #ifndef PRAGMA_ENUM_PACK
  1087.     #define PRAGMA_ENUM_PACK            0
  1088.     #endif
  1089.     #ifndef PRAGMA_ENUM_ALWAYSINT
  1090.     #define PRAGMA_ENUM_ALWAYSINT        0
  1091.     #endif
  1092.     #ifndef PRAGMA_ENUM_OPTIONS
  1093.     #define PRAGMA_ENUM_OPTIONS            0
  1094.     #endif
  1095.     #ifndef FOUR_CHAR_CODE
  1096.     #define FOUR_CHAR_CODE(x)            (x)
  1097.     #endif
  1098.  
  1099.     #ifndef TYPE_EXTENDED
  1100.     #define TYPE_EXTENDED                0
  1101.     #endif
  1102.     #ifndef TYPE_LONGLONG
  1103.     #define TYPE_LONGLONG                0
  1104.     #endif
  1105.     #ifndef TYPE_BOOL
  1106.     #define TYPE_BOOL                    0
  1107.     #endif
  1108. #endif
  1109.  
  1110.  
  1111.  
  1112.  
  1113. /****************************************************************************************************
  1114.  
  1115.     EXTERN_API≈    
  1116.     These conditionals are used to specify the calling convention of a function.
  1117.     Mac classic 68K and Win32 each have two possible calling conventions:
  1118.  
  1119.         EXTERN_API                - Classic 68K pascal, Win32 __cdecl
  1120.         EXTERN_API_C            - Classic 68K C,      Win32 __cdecl
  1121.         EXTERN_API_STDCALL        - Classic 68K pascal, Win32 __stdcall
  1122.         EXTERN_API_C_STDCALL    - Classic 68K C,      Win32 __stdcall
  1123.  
  1124.  
  1125.     CALLBACK_API≈    
  1126.     These conditionals are used to specify the calling convention of a function pointer.
  1127.     Mac classic 68K and Win32 each have two possible calling conventions:
  1128.  
  1129.         CALLBACK_API            - Classic 68K pascal, Win32 __stdcall
  1130.         CALLBACK_API_C            - Classic 68K C,      Win32 __stdcall
  1131.         CALLBACK_API_STDCALL    - Classic 68K pascal, Win32 __cdecl
  1132.         CALLBACK_API_C_STDCALL    - Classic 68K C,      Win32 __cdecl
  1133.  
  1134. ****************************************************************************************************/
  1135. #if TARGET_OS_MAC
  1136.     /*
  1137.         Mac OS
  1138.     */
  1139.     #define EXTERN_API(_type)                        extern pascal _type        /* Note: all Mac OS compilers must be able to handle the pascal keyword */
  1140.     #define EXTERN_API_C(_type)                        extern _type
  1141.     #define EXTERN_API_STDCALL(_type)                extern pascal _type
  1142.     #define EXTERN_API_C_STDCALL(_type)                extern _type
  1143.     #define CALLBACK_API(_type, _name)                pascal _type (*_name)
  1144.     #define CALLBACK_API_C(_type, _name)            _type (*_name)
  1145.     #define CALLBACK_API_STDCALL(_type, _name)        pascal _type (*_name)
  1146.     #define CALLBACK_API_C_STDCALL(_type, _name)    _type (*_name)
  1147. #elif TARGET_OS_WIN32
  1148.     /*
  1149.         Win32 
  1150.     */
  1151.     #define EXTERN_API(_type)                        _type __cdecl
  1152.     #define EXTERN_API_C(_type)                        _type __cdecl
  1153.     #define EXTERN_API_STDCALL(_type)                _type __stdcall
  1154.     #define EXTERN_API_C_STDCALL(_type)                _type __stdcall
  1155.     #define CALLBACK_API(_type, _name)                _type (__cdecl * _name)
  1156.     #define CALLBACK_API_C(_type, _name)            _type (__cdecl * _name)
  1157.     #define CALLBACK_API_STDCALL(_type, _name)        _type (__stdcall * _name)
  1158.     #define CALLBACK_API_C_STDCALL(_type, _name)    _type (__stdcall * _name)
  1159. #else
  1160.     /*
  1161.         Unix or anything else
  1162.     */
  1163.     #define EXTERN_API(_type)                        extern _type
  1164.     #define EXTERN_API_C(_type)                        extern _type
  1165.     #define EXTERN_API_STDCALL(_type)                extern _type
  1166.     #define EXTERN_API_C_STDCALL(_type)                extern _type
  1167.     #define CALLBACK_API(_type, _name)                _type (*_name)
  1168.     #define CALLBACK_API_C(_type, _name)            _type (*_name)
  1169.     #define CALLBACK_API_STDCALL(_type, _name)        _type (*_name)
  1170.     #define CALLBACK_API_C_STDCALL(_type, _name)    _type (*_name)    
  1171. #endif
  1172.  
  1173.  
  1174. /*  Backwards compatibility for clients expecting Universal Interfacew 3.0d7 (Interfacer 2.d014) style */
  1175. #define EXTERN_API_1    EXTERN_API_STDCALL
  1176. #define EXTERN_API_2    EXTERN_API_C_STDCALL
  1177. #define EXTERN_API_3    EXTERN_API
  1178. #define EXTERN_API_4    EXTERN_API_C
  1179. #define CALLBACK_API_1    CALLBACK_API_STDCALL
  1180. #define CALLBACK_API_2    CALLBACK_API_C_STDCALL
  1181. #define CALLBACK_API_3    CALLBACK_API
  1182. #define CALLBACK_API_4    CALLBACK_API_C
  1183.  
  1184. /****************************************************************************************************
  1185.     Backward compatibility for clients expecting 2.x version on ConditionalMacros.h
  1186.  
  1187.     GENERATINGPOWERPC        - Compiler is generating PowerPC instructions
  1188.     GENERATING68K            - Compiler is generating 68k family instructions
  1189.     GENERATING68881            - Compiler is generating mc68881 floating point instructions
  1190.     GENERATINGCFM            - Code being generated assumes CFM calling conventions
  1191.     CFMSYSTEMCALLS            - No A-traps.  Systems calls are made using CFM and UPP's
  1192.     PRAGMA_ALIGN_SUPPORTED    - Compiler supports: #pragma options align=mac68k/power/reset
  1193.     PRAGMA_IMPORT_SUPPORTED    - Compiler supports: #pragma import on/off/reset
  1194.  
  1195. ****************************************************************************************************/
  1196. #if TARGET_OS_MAC
  1197. #define GENERATINGPOWERPC TARGET_CPU_PPC
  1198. #define GENERATING68K TARGET_CPU_68K
  1199. #define GENERATING68881 TARGET_RT_MAC_68881
  1200. #define GENERATINGCFM TARGET_RT_MAC_CFM
  1201. #define CFMSYSTEMCALLS TARGET_RT_MAC_CFM
  1202. #define PRAGMA_ALIGN_SUPPORTED    PRAGMA_STRUCT_ALIGN
  1203. #define PRAGMA_IMPORT_SUPPORTED PRAGMA_IMPORT
  1204. /*
  1205.     NOTE: The FOR_≈ conditionals were developed to produce integerated
  1206.           interface files for System 7 and Copland.  Now that Copland
  1207.           is canceled, all FOR_ conditionals have been removed from
  1208.           the interface files.  But, just in case you someone got an 
  1209.           interface file that uses them, the following sets the FOR_≈
  1210.           conditionals to a consistent, usable state.
  1211.  
  1212.     #define FOR_OPAQUE_SYSTEM_DATA_STRUCTURES        0
  1213.     #ifndef FOR_PTR_BASED_AE
  1214.         #define FOR_PTR_BASED_AE                    0
  1215.     #endif
  1216.     #define FOR_SYSTEM7_ONLY                        1
  1217.     #define FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED        1
  1218.     #define FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE        1
  1219.     #define FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE        1
  1220.     #define FOR_SYSTEM8_COOPERATIVE                    0
  1221.     #define FOR_SYSTEM8_PREEMPTIVE                    0
  1222. */
  1223. #define FOR_OPAQUE_SYSTEM_DATA_STRUCTURES     ..FOR_OPAQUE_SYSTEM_DATA_STRUCTURES_is_an_obsolete_Coplandism..
  1224. #define FOR_PTR_BASED_AE                     ..FOR_PTR_BASED_AE_is_an_obsolete_Coplandism..
  1225. #define FOR_SYSTEM7_ONLY                     ..FOR_SYSTEM7_ONLY_is_an_obsolete_Coplandism..
  1226. #define FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED     ..FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED_is_an_obsolete_Coplandism..
  1227. #define FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE ..FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE_is_an_obsolete_Coplandism..
  1228. #define FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE    ..FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE_is_an_obsolete_Coplandism..
  1229. #define FOR_SYSTEM8_COOPERATIVE             ..FOR_SYSTEM8_COOPERATIVE_is_an_obsolete_Coplandism..
  1230. #define FOR_SYSTEM8_PREEMPTIVE                 ..FOR_SYSTEM8_PREEMPTIVE_is_an_obsolete_Coplandism..
  1231. #endif  /* TARGET_OS_MAC */
  1232.  
  1233.  
  1234.  
  1235. /****************************************************************************************************
  1236.  
  1237.     OLDROUTINENAMES            - "Old" names for Macintosh system calls are allowed in source code.
  1238.                               (e.g. DisposPtr instead of DisposePtr). The names of system routine
  1239.                               are now more sensitive to change because CFM binds by name.  In the 
  1240.                               past, system routine names were compiled out to just an A-Trap.  
  1241.                               Macros have been added that each map an old name to its new name.  
  1242.                               This allows old routine names to be used in existing source files,
  1243.                               but the macros only work if OLDROUTINENAMES is true.  This support
  1244.                               will be removed in the near future.  Thus, all source code should 
  1245.                               be changed to use the new names! You can set OLDROUTINENAMES to false
  1246.                               to see if your code has any old names left in it.
  1247.     
  1248.     OLDROUTINELOCATIONS     - "Old" location of Macintosh system calls are used.  For example, c2pstr 
  1249.                               has been moved from Strings to TextUtils.  It is conditionalized in
  1250.                               Strings with OLDROUTINELOCATIONS and in TextUtils with !OLDROUTINELOCATIONS.
  1251.                               This allows developers to upgrade to newer interface files without 
  1252.                               having to change the includes in their source code.  But, it allows
  1253.                               the slow migration of system calls to more understandable file locations.  
  1254.                               OLDROUTINELOCATIONS currently defaults to true, but eventually will 
  1255.                               default to false.
  1256.  
  1257. ****************************************************************************************************/
  1258. #ifndef OLDROUTINENAMES
  1259. #define OLDROUTINENAMES 0
  1260. #endif  /* !defined(OLDROUTINENAMES) */
  1261.  
  1262. #ifndef OLDROUTINELOCATIONS
  1263. #define OLDROUTINELOCATIONS 0
  1264. #endif  /* !defined(OLDROUTINELOCATIONS) */
  1265.  
  1266.  
  1267.  
  1268. /****************************************************************************************************
  1269.     C specific conditionals
  1270.  
  1271.     CGLUESUPPORTED            - Interface library will support "C glue" functions (function names
  1272.                               are: all lowercase, use C strings instead of pascal strings, use 
  1273.                               Point* instead of Point).
  1274.  
  1275. ****************************************************************************************************/
  1276. #ifndef CGLUESUPPORTED
  1277. #if TARGET_OS_MAC && !defined(THINK_C)
  1278. #define CGLUESUPPORTED 1
  1279. #else
  1280. #define CGLUESUPPORTED 0
  1281. #endif  /* TARGET_OS_MAC && !defined(THINK_C) */
  1282.  
  1283. #endif  /* !defined(CGLUESUPPORTED) */
  1284.  
  1285.  
  1286.  
  1287. /****************************************************************************************************
  1288.     The following macros isolate the use of 68K inlines in function prototypes.
  1289.     On the Mac OS under the Classic 68K runtime, function prototypes were followed
  1290.     by a list of 68K opcodes which the compiler inserted in the generated code instead
  1291.     of a JSR.  Under Classic 68K on the Mac OS, this macro will put the opcodes
  1292.     in the right syntax.  For all other OS's and runtimes the macro suppress the opcodes.
  1293.     Example:
  1294.     
  1295.         EXTERN_P void DrawPicture(PicHandle myPicture, const Rect *dstRect)
  1296.              ONEWORDINLINE(0xA8F6);
  1297.     
  1298. ****************************************************************************************************/
  1299.  
  1300. #if TARGET_OS_MAC && !TARGET_RT_MAC_CFM
  1301.     #define ONEWORDINLINE(w1) = w1
  1302.     #define TWOWORDINLINE(w1,w2) = {w1,w2}
  1303.     #define THREEWORDINLINE(w1,w2,w3) = {w1,w2,w3}
  1304.     #define FOURWORDINLINE(w1,w2,w3,w4)  = {w1,w2,w3,w4}
  1305.     #define FIVEWORDINLINE(w1,w2,w3,w4,w5) = {w1,w2,w3,w4,w5}
  1306.     #define SIXWORDINLINE(w1,w2,w3,w4,w5,w6)     = {w1,w2,w3,w4,w5,w6}
  1307.     #define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7)      = {w1,w2,w3,w4,w5,w6,w7}
  1308.     #define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8)      = {w1,w2,w3,w4,w5,w6,w7,w8}
  1309.     #define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9)      = {w1,w2,w3,w4,w5,w6,w7,w8,w9}
  1310.     #define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10)  = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10}
  1311.     #define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11)      = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11}
  1312.     #define TWELVEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12)      = {w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12}
  1313. #else
  1314.     #define ONEWORDINLINE(w1)
  1315.     #define TWOWORDINLINE(w1,w2)
  1316.     #define THREEWORDINLINE(w1,w2,w3)
  1317.     #define FOURWORDINLINE(w1,w2,w3,w4)
  1318.     #define FIVEWORDINLINE(w1,w2,w3,w4,w5)
  1319.     #define SIXWORDINLINE(w1,w2,w3,w4,w5,w6)
  1320.     #define SEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7)
  1321.     #define EIGHTWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8)
  1322.     #define NINEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9)
  1323.     #define TENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10)
  1324.     #define ELEVENWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11)
  1325.     #define TWELVEWORDINLINE(w1,w2,w3,w4,w5,w6,w7,w8,w9,w10,w11,w12)
  1326. #endif
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332. #endif /* __CONDITIONALMACROS__ */
  1333.  
  1334.